
package ija.xls.xml.game;

import ija.model.types.FigureColor;
import ija.model.types.FigureDirection;
import ija.xls.notation.DeskCoordinate;

/**
 *
 * @author Radek Necas, xnecas18
 */
public class FigureDescription {

    public static enum FigureType {
        QUEEN, PIECE;
        
        public static FigureType getFromString(String s) {
            if(s.equalsIgnoreCase("QUEEN")) {
                return QUEEN;
            }
            else if(s.equalsIgnoreCase("PIECE")) {
                return PIECE;
            }
            
            return null;
        }
        
        @Override
        public String toString() {
            if(this == QUEEN) {
                return "QUEEN";
            }
            else if(this == PIECE) {
                return "PIECE";
            }
            return null;
        }
    }
    
    
    protected DeskCoordinate pos;
    protected FigureType type;
    protected FigureDirection direction;
    protected FigureColor color;
    
    public FigureDescription(DeskCoordinate pos, FigureType t, FigureDirection d, FigureColor c) {
        this.pos = pos;
        this.type = t;
        this.direction = d;
        color = c;
    }
    
    public DeskCoordinate getCoordinate() {
        return pos;
    }
    
    public FigureType getFigureType() {
        return type;
    }
    
    public FigureDirection getDirection() {
        return direction;
    }
    
    public FigureColor getColor() {
        return color;
    }
    
    public void setCoordinate(DeskCoordinate newPos) {
        pos = newPos;
    }
    
    public void setFigureType(FigureType newType) {
        type = newType;
    }
    
    public void setDirection(FigureDirection newDirection) {
        direction = newDirection;
    }
    
    public void setColor(FigureColor newColor) {
        color = newColor;
    }
    
    @Override
    public String toString() {
        return ("Type: " + type.toString() + " position: " + pos.toString() + " direction: " + direction.toString() + " color: " + color.toString());
    }
    
    
}
